using huqiang.Core.HGUI;
using System;
using UnityEngine;
using huqiang.UIComposite;
using huqiang.UIEvent;
using huqiang;
using huqiang.Data;
using huqiang.UIModel;

public class DockPanelPage:UIPage
{
    //反射UI界面上的物体
    class View
    {
        public DockPanel dockPanel;
    }
    View view;
    public override void Initial(UIElement parent, object dat = null)
    {
        base.Initial(parent, dat);
        view = LoadUI<View>("baseUI", "DockPanelPage");//"baseUI"创建的bytes文件名,"page"为创建的页面名
        DockPanelLine.CursorX = Resources.Load<Texture2D>("StretchWX");
        DockPanelLine.CursorY = Resources.Load<Texture2D>("StretchWY");
        InitialData();
    }
    void InitialData()
    {
        var area = view.dockPanel.MainArea.AddArea(DockpanelArea.Dock.Down);
        area.model.MainColor = Color.red;
        var rightdown = area.AddArea(DockpanelArea.Dock.Right);
        rightdown.model.MainColor = Color.green;
        var lefttop = view.dockPanel.MainArea.AddArea(DockpanelArea.Dock.Left);
        lefttop.model.MainColor = Color.blue;
        view.dockPanel.Refresh();
    }
}
